package com.qut.system_1.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

//表示该类是操作数据库的类
//自动创建对象
@Mapper
public interface RegisterMapper {
    //添加
    @Insert("insert into t_use" +  //插入 不允许为空的
            "( rid,name,Money,sex,age,department," +  //列名
            " status,registerDate)"+
            " values (#{rid},#{name},#{Money},#{sex},#{age}," +  //页面提交的值
            " #{department},#{status},#{registerDate})")
    int add1(Map<String, String> param);
    //查询
    List<Map<String, Object>> search(Map<String, String> param);
    //修改
    @Update("update t_use set name=#{name}," +
            " Money=#{Money},sex=#{sex},age=#{age},department=#{department}," +
            " status=#{status},registerDate=#{registerDate} "+
            " where rid=#{rid}")
    int update(Map<String,String> param);

    int batchDelete(String[] ids);
}
